home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 October / DPPCPRO1005.ISO / Download / Web Developer / webdeveloper.xpi / chrome / webdeveloper.jar / content / webdeveloper / dialogs / resize.js < prev    next >
Encoding:
JavaScript  |  2005-03-21  |  746 b   |  20 lines

  1. // Initializes the resize dialog
  2. function webdeveloper_initializeResize()
  3. {
  4.     document.getElementById("webdeveloper-resize-width").value = window.arguments[0];
  5.     document.getElementById("webdeveloper-resize-height").value = window.arguments[1];
  6. }
  7.  
  8. // Resizes the parent window to the given width and height
  9. function webdeveloper_resizeParentWindow()
  10. {
  11.     const height = document.getElementById("webdeveloper-resize-height").value;
  12.     const width  = document.getElementById("webdeveloper-resize-width").value;
  13.  
  14.     // If the width and height are valid
  15.     if(width && height && parseInt(width) == width && parseInt(height) == height && width > 0 && height > 0)
  16.     {
  17.         window.opener.resizeTo(width, height);
  18.     }
  19. }
  20.